package com.xx.controller;

import com.xx.entity.Orgnazition;
import com.xx.service.OrgnazitionService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
/**
 * @author 许欣
 * 时间：2022/5/2 20:26
 * 描述：
 */
@Controller
@RequestMapping("/orgnazition")
public class OrgnazitionController {
    @Resource
    private OrgnazitionService orgnazitionService;

    @RequestMapping(value = "/list")
    public String findAll(Model model){
        model.addAttribute("list", orgnazitionService.findAll());
        return "list";
    }
    @RequestMapping("/toAdd")
    public String toAdd(){
        return "add";
    }

    @RequestMapping("/add")
    public String add(Orgnazition orgnazition){
        orgnazitionService.Add(orgnazition);
        return "redirect:/orgnazition/list";
    }

}
